# 等差数列练习题
# 使用range生成等差数列，起始值为18，公差为3，最大值为210
# 并将数列求和∑
# 遍历法
sum_num = 0
for num in range(18, 210, 3):
    sum_num += num
print(sum_num)

l = list(range(18, 210, 3))
print(sum(l))
